<?php
namespace Home\Model;
use Think\Model;

/**
 * Created by PhpStorm.
 * Email: jhasheng@hotmail.com
 * Date: 2015/5/23
 * Time: 19:23
 */

class CategoryModel extends Model
{
    protected $_auto = array(
        array('sc_addtime', 'time', parent::MODEL_INSERT, 'function'),
        array('sc_udpatetime', 'time', parent::MODEL_UPDATE, 'function'),
        array('sc_last_uid', 'getUid', parent::MODEL_BOTH, 'callback')
    );

    protected $_validate = array(
        array('sc_pid', 'require', '请选择父分类', parent::MUST_VALIDATE),
        array('sc_name', 'require', '请填写分类名称', parent::MUST_VALIDATE),
        array('sc_ename', 'require', '请填写分类英文名称', parent::MUST_VALIDATE),
    );


    public function getUid()
    {
        return 1;
    }

}